<!doctype html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.2.12.min.js"></script>
<link href="style/login.css" rel="stylesheet" type="text/css">
<script>

	window.onload = function () {
		document.getElementById('submit').onclick = login;
	}
	
	var login = function()
	{
		Parse.initialize("EL9rGBARwKQl3NL4HAQ2U4GxQYjXV8dDDvDDaTPe", "WQLflsIP1zoVHCZgNjpr95dtrmaqjCaCkWSbOSrU");
		var username=document.getElementById('username').value;
		var password=document.getElementById('password').value;
		Parse.User.logIn(username, password, {
			success: function(user) {
				// Direct to home page
				window.location.href="index.html";
			
			},
			error: function(user, error) {
				// The display error message
				alert("Error: " + error.message);
			}
		});
	}

</script>

</br> </br> </br> </br> </br>
<form>
  <h1>Log in</h1>
  <div class="inset">
  <p>
    <label for="email">USERNAME</label>
    <input type="text" name="username" id="username">
  </p>
  <p>
    <label for="password">PASSWORD</label>
    <input type="password" name="password" id="password">
  </p>

  </div>

  <p class="p-container">
	  No account? &nbsp; &nbsp; &nbsp; <a href="register.html">Register</a>
    <input type="button" name="submit" id="submit" value="Log in">
  </p>
</form>




